/**
 *  *  This file is part of Spidex.
 *  
 *  Spidex is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Spidex is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Spidex.  If not, see <http://www.gnu.org/licenses/>.
 */
package spidex.dbmanager;

import java.sql.SQLException;
import java.util.List;
import javax.swing.JTable;
import spidex.DVDInfo;

public interface DBManager {
    /**
     * Open database and checks whether all tables are in db, 
     * otherwise tables are created
     * @param dbUrl
     * @throws ClassNotFoundException whether jdbc isn't included
     * @throws SQLException when connection failed
     */
    public void openDb(String dbUrl) throws ClassNotFoundException, SQLException;

    public int insertRecord (DVDInfo record) throws SQLException;
    
    public void updateRecord(DVDInfo info) throws SQLException;

    public void deleteRecord (DVDInfo record) throws SQLException;

    public void editRecord (DVDInfo record) throws SQLException;
    
    public boolean existEntry(int id) throws SQLException;

    public List<DVDInfo> findEntries (DBCondition condition) throws SQLException;
    
    public void findEntries (DBCondition condition,JTable table) throws SQLException;
    
    public void close() throws SQLException;

}

